<!--
 * @Description: 
 * @Author: gphper
 * @Date: 2021-10-19 20:03:02
-->
{{define "head"}}
<style>
  .img-div{
    margin-top: 10px;
  }
  .img-div img{
    width: 100px;
  }
</style>
{{end}}

{{define "body"}}
<div class="container-fluid p-t-15">
  
    <div class="row">
      <div class="col-lg-8">
        <div class="card">
          <div class="card-body">
            
            <form action="/admin/article/save" method="post" class="row ajaxForm"  autocomplete="off">
            <input type="hidden" name="article_id" value="{{.article.ArticleId}}"/>
             
            <div class="form-group col-md-12">
                <label for="title">标题</label>
                <input type="text" class="form-control" name="title" value="{{ .article.Title }}" autocomplete="off" />
            </div>

            <div class="form-group col-md-12">
                <label for="title">封面图</label>    
            </div>

            <div class="form-group col-md-12">
                <button type="button" onclick="upload_resource('封面图上传','UP_COMMON','cover_img',1)" class="btn btn-sm btn-w-md btn-info">封面图上传</button>
                <div id="cover_img">
                  {{if .article.CoverImg}}
                  <div class="img-div"><img src="/{{ .article.CoverImg }}"><span onclick="del_img($(this))">×</span><input type="hidden" name="cover_img" value="{{.article.CoverImg}}"></div>
                  {{end}}
                </div>
            </div>

            <div class="form-group col-md-12">
                <label for="title">描述</label>
                <input type="text" class="form-control" name="desc" value="{{.article.Desc}}" autocomplete="off" />
            </div>

            <div class="form-group col-md-12">
                <label for="title">内容</label>
                <textarea class="form-control" id="example-textarea-input" name="content" rows="6" placeholder="内容..">{{.article.Content}}</textarea>
            </div>
              
            <div class="form-group col-md-12">
                <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
                <button type="button" class="btn btn-default" onclick="javascript:location.href=document.referrer">返 回</button>
            </div>
            </form>
   
          </div>
        </div>
      </div>
      
    </div>
    
  </div>
{{end}}

{{define "script"}}
<script type="text/javascript" src="/statics/js/upload/upload_resource.js"></script>
{{end}}